﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using LeadVinaglue.Models.ViewPages;
using LeadVinaglue.Models;

namespace LeadVinaglue.Repository
{
    public class EmailManagementRepository : BaseManagementRepository
    {
        EmailTemplateRepository repository = new EmailTemplateRepository();

        public EmailManagementModel GetModel(string pageType, string roleName, int id)
        {
            EmailManagementModel model = new EmailManagementModel();

            model.HeaderView = GetHeader();
            model.MenuItem = GetMenuItems(roleName, pageType);
            model.ListEmail = repository.GetAll();

            if (id > 0)
            {
                model.EmailInfo = repository.GetModelItem(id);
            }

            return model;
        }

        public EmailManagementModel GetModel(string pageType, string roleName)
        {
            EmailManagementModel model = new EmailManagementModel();
            model.ListEmail = repository.GetAll();

            return model;
        }
    }
}